
public class ArrayDemo {
	public static void main(String[] args) {
        int i;
		
        
     
        
        
        
		// declares an array of integers
        int[] anArray;

        // allocates memory for 10 integers
        anArray = new int[10];
        
        
        int[] array1= new int[10];
        
        System.out.println(array1[0]);
        
        
        array1[0] = 1;
        array1[9] = 1;
        //array1[10] = 1;
        
        System.out.println("first element"+array1[0]);
        
        int j  = array1[9];
        System.out.println(j);
        
           
        // initialize first element
        anArray[0] = 100;
        // initialize second element
        anArray[1] = 200;
        // and so forth
        anArray[2] = 300;
        anArray[3] = 400;
        anArray[4] = 500;
        anArray[5] = 600;
        anArray[6] = 700;
        anArray[7] = 800;
        anArray[8] = 900;
        anArray[9] = 1000;

//        System.out.println("Element at index 0: "
//                           + anArray[0]);
//        System.out.println("Element at index 1: "
//                           + anArray[1]);
//        System.out.println("Element at index 2: "
//                           + anArray[2]);
//        System.out.println("Element at index 3: "
//                           + anArray[3]);
//        System.out.println("Element at index 4: "
//                           + anArray[4]);
//        System.out.println("Element at index 5: "
//                           + anArray[5]);
//        System.out.println("Element at index 6: "
//                           + anArray[6]);
//        System.out.println("Element at index 7: "
//                           + anArray[7]);
//        System.out.println("Element at index 8: "
//                           + anArray[8]);
//        System.out.println("Element at index 9: "
//                           + anArray[9]);
        
        
        int i1=0;
        while(i1 < 20)
        {
        	System.out.println("mahi");
        	i1=i1+1;
        }
        
        for(int test: anArray)
        {
        	System.out.println("test "+test);
        }
        
        String name = "mahi";
        while(name=="mahi")
        {
        	name = "xyz";
        }
        
        for (int X = 0; X < anArray.length; X++) {
        	System.out.println("Element at index "+X+": "+ anArray[X]);
		}
        
//        
//        while(true)
//        {
//        	System.out.println("free");
//        }
        
//        for (;;) {
//        	System.out.println("free");
//		}
//        
        /*
         * 1.  Start condition
         * 2. Terminal condition
         * 3. 
         */
        
        
        
      
        
//        int[] arrayFirst= new int[20];
//        arrayFirst[0] =  anArray[0];
//        arrayFirst[1] =  anArray[1];
//        
//        arrayFirst[9] =  anArray[9];
//        arrayFirst[10] = 1100;

        
        
        
        
	}
}
